﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Webcar.SysManage
{
    public partial class SelectCQEPUser : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.TextBox1.Text.Trim() == "") return;
            this.BindData(this.TextBox1.Text);
        }

        public void BindData(string name)
        {
            if (string.IsNullOrEmpty(name))
                return;
            string sql = @"select a.account,a.password,a.name,b.deptname from sys_cqep_user a,sys_cqep_dept b
                            where a.deptcode =b.deptcode and a.name like '%{0}%'";

            this.GridView1.DataSource = ToolsLayer.DB.ExecuteDataset(string.Format(sql, name));
            this.GridView1.DataBind();
        }
    }
}
